home *** CD-ROM | disk | FTP | other *** search
- diff -cbBw orig/files.c ./files.c
- *** orig/files.c Tue Jun 26 00:02:18 1990
- --- ./files.c Sun Jul 01 23:35:18 1990
- ***************
- *** 183,196 ****
- filename = getenv("BISON_SIMPLE");
- #ifdef MSDOS
- /* file doesn't exist in curent directory, try in INIT directory */
- ! cp = getenv("INIT");
- if (filename == 0 && cp != 0)
- {
- ! filename = malloc(strlen(cp) + strlen(PFILE) + 2);
- ! strcpy(filename, cp);
- ! cp = filename + strlen(filename);
- ! *cp++ = '/';
- ! strcpy(cp, PFILE);
- }
- #endif /* MSDOS */
- fparser = tryopen(filename ? filename : PFILE, "r");
- --- 183,195 ----
- filename = getenv("BISON_SIMPLE");
- #ifdef MSDOS
- /* file doesn't exist in curent directory, try in INIT directory */
- ! cp = getenv("PATH");
- if (filename == 0 && cp != 0)
- {
- ! filename = malloc(255);
- ! _searchenv(PFILE, "PATH", filename);
- ! if ( filename[0] == 0 )
- ! strcpy(filename,PFILE);
- }
- #endif /* MSDOS */
- fparser = tryopen(filename ? filename : PFILE, "r");
- ***************
- *** 271,284 ****
- filename = (char *) getenv ("BISON_HAIRY");
- #ifdef MSDOS
- /* file doesn't exist in curent directory, try in INIT directory */
- ! cp = getenv("INIT");
- if (filename == 0 && cp != 0)
- {
- ! filename = malloc(strlen(cp) + strlen(PFILE1) + 2);
- ! strcpy(filename, cp);
- ! cp = filename + strlen(filename);
- ! *cp++ = '/';
- ! strcpy(cp, PFILE1);
- }
- #endif
- fparser= tryopen(filename ? filename : PFILE1, "r");
- --- 270,282 ----
- filename = (char *) getenv ("BISON_HAIRY");
- #ifdef MSDOS
- /* file doesn't exist in curent directory, try in INIT directory */
- ! cp = getenv("PATH");
- if (filename == 0 && cp != 0)
- {
- ! filename = malloc(255);
- ! _searchenv(PFILE1, "PATH", filename);
- ! if ( filename[0] == 0 )
- ! strcpy(filename,PFILE1);
- }
- #endif
- fparser= tryopen(filename ? filename : PFILE1, "r");
- ***************
- *** 303,308 ****
- --- 301,319 ----
- char *mode;
- {
- FILE *ptr;
- +
- + #ifdef MSDOS
- + char drive[3], path[128], fname[16], ext[16];
- +
- + _splitpath(name, drive, path, fname, ext);
- +
- + if ( strlen(fname) > 8 )
- + fname[8] = 0;
- + if ( strlen(ext) > 4 )
- + ext[4] = 0;
- +
- + _makepath(name, drive, path, fname, ext);
- + #endif
-
- ptr = fopen(name, mode);
- if (ptr == NULL)
- diff -cbBw orig/files.h ./files.h
- *** orig/files.h Tue Jun 26 00:02:18 1990
- --- ./files.h Sun Jul 01 23:26:24 1990
- ***************
- *** 40,45 ****
- --- 40,46 ----
-
- /* File name pfx specified with -b, or 0 if no -b. */
- extern char *spec_file_prefix;
- + extern char *spec_name_prefix;
-
- extern char *infile;
- extern char *outfile;
- diff -cbBw orig/getargs.c ./getargs.c
- *** orig/getargs.c Tue Jun 26 00:02:18 1990
- --- ./getargs.c Sun Jul 01 23:27:46 1990
- ***************
- *** 27,33 ****
- --- 27,35 ----
- int debugflag;
- int nolinesflag;
- char *spec_name_prefix; /* For -a. */
- + char *spec_file_prefix; /* -b */
- extern int fixed_outfiles;/* JF */
- + extern char *version_string;
-
- extern int getopt();
- extern void fatal();
- ***************
- *** 65,70 ****
- --- 67,75 ----
- fixed_outfiles = 1;
- #endif
-
- + if ( argc == 1 )
- + usage(argv[0]);
- +
- while ((c = getopt (argc, argv, "yvdlto:b:a:")) != EOF)
- switch (c)
- {
- ***************
- *** 74,82 ****
-
- case 'v':
- if(optind && argv[optind] && !strcmp(argv[optind],"-version")) {
- - extern char *version_string;
-
- ! printf("%s",version_string);
- while(getopt(argc,argv,"ersion")!='n')
- ;
- } else
- --- 79,86 ----
-
- case 'v':
- if(optind && argv[optind] && !strcmp(argv[optind],"-version")) {
-
- ! printf("\n%s",version_string);
- while(getopt(argc,argv,"ersion")!='n')
- ;
- } else
- ***************
- *** 115,118 ****
- --- 119,154 ----
-
- if (optind < argc - 1)
- fprintf(stderr, "bison: warning: extra arguments ignored\n");
- + }
- +
- +
- + usage(name)
- + char *name;
- + {
- + printf("\n%s", version_string);
- +
- + printf("\nUsage: %s [-dltvy] [-o file] file\n", name);
- +
- + printf("\n -d Produce a .tab.h file, similar to yacc's y.tab.h file."
- +
- + "\n -l Omit #line lines in the parser output file. Error mes-"
- + "\n sages from the C compiler will then be associated with"
- + "\n lines in the parser output file, instead of lines in"
- + "\n the original grammar file.");
- +
- + printf("\n -t Turn on debugging. This option causes the bison output"
- + "\n to have debugging code made available via the C pre-"
- + "\n processor. The external variable yydebug should be"
- + "\n made non-zero to have the debugging code actually pro-"
- + "\n duce output.");
- +
- + printf("\n -v Be verbose. Analogous to the same flag for yacc."
- +
- + "\n -y Use fixed output file names. I.e., force the output to"
- + "\n be in files y.tab.c, y.tab.h, and so on. This is for"
- + "\n full yacc compatibility."
- +
- + "\n -o file Define special output file name.\n");
- +
- + exit(1);
- }
- diff -cbBw orig/lex.c ./lex.c
- *** orig/lex.c Tue Jun 26 00:02:18 1990
- --- ./lex.c Sun Jul 01 23:16:34 1990
- ***************
- *** 220,226 ****
- else if (c == 'n')
- code = '\n';
- else if (c == 'a')
- ! code = '007';
- else if (c == 'r')
- code = '\r';
- else if (c == 'f')
- --- 220,226 ----
- else if (c == 'n')
- code = '\n';
- else if (c == 'a')
- ! code = 007;
- else if (c == 'r')
- code = '\r';
- else if (c == 'f')
- diff -cbBw orig/main.c ./main.c
- *** orig/main.c Tue Jun 26 00:02:20 1990
- --- ./main.c Sun Jul 01 23:08:42 1990
- ***************
- *** 90,98 ****
- extern char *infile;
-
- if (infile == 0)
- ! fprintf(stderr, "fatal error: %s\n", s);
- else
- ! fprintf(stderr, "\"%s\", line %d: %s\n", infile, lineno, s);
- done(1);
- }
-
- --- 90,98 ----
- extern char *infile;
-
- if (infile == 0)
- ! fprintf(stderr, "\nfatal error: %s\n", s);
- else
- ! fprintf(stderr, "\n\"%s\", line %d: %s\n", infile, lineno, s);
- done(1);
- }
-
- diff -cbBw orig/reader.c ./reader.c
- *** orig/reader.c Tue Jun 26 00:02:20 1990
- --- ./reader.c Sun Jul 01 23:14:50 1990
- ***************
- *** 33,38 ****
- --- 33,39 ----
- #include "symtab.h"
- #include "lex.h"
- #include "gram.h"
- + #include "machine.h"
-
-
- #define LTYPESTR "\n#ifndef YYLTYPE\ntypedef\n struct yyltype\n\
-